/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

package com.sh.ndt.question.mapper;

import com.sh.ndt.common.mapper.BaseRowMapper;
import com.sh.ndt.question.entity.Question;
import java.sql.ResultSet;
import java.sql.SQLException;

/**
 *
 * @author Prashanth
 */
public class QuestionMapper extends BaseRowMapper{

    @Override
    public Object mapRow(ResultSet rs, int i) throws SQLException {
        Question question = new Question();
        
        question.setRownum(rs.getInt("ROWNUM"));
        question.setQuestionId(rs.getLong("QUESTION_ID"));
        question.setQuestion(rs.getString("QUESTION"));
        question.setCategoryId(rs.getInt("CATEGORY"));
        question.setOption1(rs.getString("OPTION1"));
        question.setOption2(rs.getString("OPTION2"));
        question.setOption3(rs.getString("OPTION3"));
        question.setOption4(rs.getString("OPTION4"));
        question.setOption5(rs.getString("OPTION5"));
        question.setOption6(rs.getString("OPTION6"));
        question.setImageRefLink(rs.getString("IMAGE_REF_LINK"));
        question.setPdfRefLink(rs.getString("PDF_REF_LINK"));
        question.setAnswer(rs.getString("ANSWER"));
        
        return question;
        
    }
    
}
